package com.company.demo.factory_pattern;

import com.company.demo.TestInterface;

public class SimpleFactoryTest implements TestInterface {
    @Override
    public void run() {

        System.out.println("简单工厂");
        Operater operater;
        Calculator calculator = new Calculator();
        calculator.setOperaterNumber(2, 3);
        operater = SimpleFactory.getProduct("+");
        calculator.setOperater(operater);
        double result = calculator.getResult();

        System.out.println("2+3=" + result);


    }
}
